package com.gitee.wsl.unit.area

import com.gitee.wsl.unit.BaseUnit
import com.gitee.wsl.unit.UnitType

enum class AreaUnitType(
    val symbol: String,
    override val baseUnit: Long,
) : UnitType<Long> {
    Decimilliare("dma", 100),
    Centiare("ca", 1_000_000),
    Deciare("da", 10_000_000),
    Are("a", 100_000_000),
    Decare("daa", 1_000_000_000),
    Hectare("ha", 10_000_000_000),
}


sealed class AreaUnit( value:Long, type: AreaUnitType): BaseUnit<Long, AreaUnitType>(value, type) {
    override fun toBase(): Long {
        return value*type.baseUnit
    }
}